package routes

import (
	"com.codingq92/go-chat/app"
	"github.com/gin-gonic/gin"
	"time"
)

// SetSysApiGroupRoutes 系统级别的路由
func SetSysApiGroupRoutes(g *gin.RouterGroup) {
	g.POST("/register", app.Register)
	g.POST("/login", app.Login)
}

// SetApiGroupRoutes 以下接口都需要鉴权
func SetApiGroupRoutes(g *gin.RouterGroup) {
	g.POST("/auth/info", app.UserInfo)
	g.POST("/auth/logout", app.Logout)
}

// SetTestGroupRoutes 测试路由
func SetTestGroupRoutes(g *gin.RouterGroup) {
	// 测试优雅停机
	g.GET("/ping", func(c *gin.Context) {
		time.Sleep(5 * time.Second)
		c.String(200, "pong")
	})
}
